home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr26 / netprog.zip / NETPROG.TAR / ipc / mainfifocli.c < prev    next >
C/C++ Source or Header  |  1989-12-17  |  583b  |  32 lines

  1. #include    "fifo.h"
  2.  
  3. main()
  4. {
  5.     int    readfd, writefd;
  6.  
  7.     /*
  8.      * Open the FIFOs.  We assume the server has already created them.
  9.      */
  10.  
  11.     if ( (writefd = open(FIFO1, 1)) < 0)
  12.         err_sys("client: can't open write fifo: %s", FIFO1);
  13.     if ( (readfd = open(FIFO2, 0)) < 0)
  14.         err_sys("client: can't open read fifo: %s", FIFO2);
  15.  
  16.     client(readfd, writefd);
  17.  
  18.     close(readfd);
  19.     close(writefd);
  20.  
  21.     /*
  22.      * Delete the FIFOs, now that we're finished.
  23.      */
  24.  
  25.     if (unlink(FIFO1) < 0)
  26.         err_sys("client: can't unlink %s", FIFO1);
  27.     if (unlink(FIFO2) < 0)
  28.         err_sys("client: can't unlink %s", FIFO2);
  29.  
  30.     exit(0);
  31. }
  32.